package com.woniuxy.receiver;


import com.rabbitmq.client.Channel;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

import java.io.IOException;
import java.util.Date;

/**
 * @Author: 曾令忠
 * @Description:
 * @Date: 2020/7/7 0007-下午 2:41
 */
@Component
public class PluginReceiver {
    @RabbitListener(queues = "delayPluginQueue")
    public void receive(Message msg, Channel channel) throws IOException {
        System.out.println("消费者接收到消息："+new String(msg.getBody())+new Date());
        channel.basicAck(msg.getMessageProperties().getDeliveryTag(),false);
    }

}
